home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
ezw1v30a.zip
/
EZWINDO.DOC
< prev
next >
Wrap
Text File
|
1991-06-03
|
20KB
|
393 lines
╔═══▒▒▒▒▒▒▒▒▒▒▒▒ Welcome to ▒▒▒▒▒▒▒▒▒▒▒▒▒════╗
║ ║
║ ┌──────────────────────────────────┐ ║▒▒
║ │ EZ-WINDOWS Pulldown Menu System │ ║▒▒
║ └──────────────────────────────────┘ ║▒▒
║ Version 3.0 ║▒▒
║ ║▒▒
║ A complete mouseable Pulldown Menu System ║▒▒
║ ║▒▒
║ ┌───────────────────────╨──────────────────┐
╚░░░░░░░▒░░░░░░░░░░░░│ │
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ For... │▒▒
│ │▒▒
│ Microsoft QuickBASIC 4.5 │▒▒
│ │▒▒
│ Microsoft Professional Development │▒▒
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄│ System 7.0 │▒▒
█ │ │▒▒
█ └──────────────────────────────────────────┘▒▒
█ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
█ StrongSoft Engineering █▒▒
█ █▒▒
█ 3155 SW 178th Ave █▒▒
█ Aloha, OR 97006 █▒▒
█ (503) 649-7251 █▒▒
█ █▒▒
█ Documentation written and prepared █▒▒
█ by John C. Strong █▒▒
█ █▒▒
█ █▒▒
█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
═══════════════════════════════════════════════════════════════════════════════
A few customer comments --
"Terrific, a beautiful piece of programming!" - Duiven, Holland
"I am very impressed with EZ-WINDOWS. It is exactly what
I was looking for..." - Ontario, Canada
"It's incredible, I just love your routines to death...I'm going
to impress the hell out of those smart 'C' programmers..."
- Houston, Texas
═══════════════════════════════════════════════════════════════════════════════
OVERVIEW
This routine is intended to allow a programmer to present the user
with options in an organized and esthetic way. The PullDown Menu System was
indeed modeled after the very pulldown menu used in the QuickBASIC 4.x
environment.
I wrote this routine out of frustration, actually. I didn't want to
take the time to write a pulldown menu routine, yet none of the commercially
available libraries offered the options that I needed. So I just sat down
one day and wrote it (over several days), and here it is.
The Pulldown Menu System is very easy to integrate in a QB program,
yet offers all the options someone might expect in a commercial software
package. To use this routine in a program, all that is required is a few
arrays containing formatting information for the pulldown menu and an array
containing the actual text used. Then a simple CALL statement will take care
of the rest! Don't worry -- loading the arrays required for the routine is
very straightforward and uncomplicated, and the results are definitely worth
it!
The advantages of using this routine are both numerous and obvious, but
there is one disadvantage: the code size is rather large. But the programs
that need such a pulldown menu routine are the ones that need to present a
multitude of options to the user -- such a program will naturally be large
anyway, so the relative code size of the Pulldown Menu System shouldn't make
a big difference.
REQUIREMENTS
The Pulldown Menu System requires QuickBASIC 4.5 compiler. It will also
work with QB40, but you'll need to purchase & recompile the source code in
QB40. I think the better investment would be to buy QB45! But I don't
know if it will work with versions eariler than 4.0. I believe earlier
versions of QuickBASIC modify the stack a bit differently when passing
parameters to assembler routines, which would definitely cause problems. So
if you don't have version 4.0 or later, you would be doing yourself a great
favor by upgrading if for no other reason than to enjoy the benefits of a
superior programming environment provided by QB45 or PDS 7.0.
You can use this routine inside the QB environment or in a compiled
.EXE file. Two Quick Libraries are provided for program development inside
QB and two libraries are provided for compiled programs.
USING THE PULLDOWN MENU SYSTEM
Using this routine requires the dimensioning and loading of several
arrays and the actual call to the routine. When calling the routine, several
conventions must be observed:
1) All non-string variable arguments must be the integer type,
denoted by the percent sign %, i.e., ITEMSLCT%. Alternativ-
ely, the DEFINT statement can be used at the beginning of
your program which will take care of this automatically. You
can also pass literals instead of integer variables, but only
for arguments that are not modified by the routine. The best
thing to do is just pass variables, which requires less stack
space than literals.
2) The arguments passed must be in proper order or the routine
will not work, possibly locking up your system.
3) All arguments must be present or the routine will not work,
possibly locking up your system.
SPECIFYING COLORS AS ATTRIBUTES
The Pulldown Menu System requires that colors be passed
as attributes instead of foreground and background colors. This
not only contributes to consistency between the routines internal
to the library but also reduces the number of arguments needing to
be passed.
So what is an attribute? An attribute is a single byte,
containing a number between 0 and 255, that tells DOS
what foreground and background color to use. Every character
on the screen has its own attribute byte in addition to the
character byte, and the attribute and character byte sit together
in video memory. This is why it is fast and efficient to use
attributes.
An attribute is the background color, multiplied by sixteen,
plus the foreground color. In hexadecimal, the background is the
high nibble and the foreground is the low nibble. To simplify
things, here is a table that yields the attribute for a given
background color and foreground color. Note that background colors
go from black to white. You can use higher numbered colors
for a background but the text will be flashing.
BACKGROUND COLOR
black blue green cyan red magenta brown white
0 1 2 3 4 5 6 7
|-----|------|------|------|------|------|------|------|
black 0 | 0 | 16 | 32 | 48 | 64 | 80 | 96 | 112 |
|-----|------|------|------|------|------|------|------|
blue 1 | 1 | 17 | 33 | 49 | 65 | 81 | 97 | 113 |
|-----|------|------|------|------|------|------|------|
green 2 | 2 | 18 | 34 | 50 | 66 | 82 | 98 | 114 |
F |-----|------|------|------|------|------|------|------|
O cyan 3 | 3 | 19 | 35 | 51 | 67 | 83 | 99 | 115 |
R |-----|------|------|------|------|------|------|------|
E red 4 | 4 | 20 | 36 | 52 | 68 | 84 | 100 | 116 |
G |-----|------|------|------|------|------|------|------|
R magenta 5 | 5 | 21 | 37 | 53 | 69 | 85 | 101 | 117 |
O |-----|------|------|------|------|-----